layui.use(['HttpRequest','form','admin'], function () {
    var studentId = Feng.getUrlParam("studentId");
    var id = Feng.getUrlParam("id");
    var form = layui.form;
    var $ = layui.$;
    var admin = layui.admin;
    var HttpRequest = layui.HttpRequest;
    let httprequset = new HttpRequest(Feng.ctxPath + '/student/detail?id=' + studentId, 'get', function (data) {
        form.val("delStudentForm",data.data);
    }, function (data) {
        Feng.error("删除失败！" + data.message);
    });
    httprequset.start();

    let httprequset2 = new HttpRequest(Feng.ctxPath + '/delapply/detail?id=' + id, 'get', function (data) {
        $("#applyReason").val(data.data.applyReason);
    }, function (data) {
        Feng.error("删除失败！" + data.message);
    });
    httprequset2.start();

    form.on('submit(btnSubmit)', function (data) {
        data.field['id'] = id;
        var request = new HttpRequest(Feng.ctxPath + "/delapply/reject", 'post', function (data) {
            Feng.success("添加成功！");
            admin.putTempData('formOk', true);
            admin.closeThisDialog();
        }, function (data) {
            Feng.error("添加失败！" + data.message)
        });
        request.set(data.field);
        request.start(true);
        return false;
    });
});